package com.lanou.utils;

import java.util.HashMap;
import java.util.Map;

public class ShiHuiResult {
    public static Map<String, Object> ok() {
        Map<String, Object> result = new HashMap<>();
        result.put("status", 200);
        return result;
    }

    public static Map<String, Object> ok(Object data) {
        Map<String, Object> result = new HashMap<>();
        result.put("status", 200);
        result.put("data", data);
        return result;
    }

    public static Map<String, Object> error(int code) {
        Map<String, Object> result = new HashMap<>();
        result.put("status", code);
        return result;
    }

    public static Map<String, Object> error(int code, String message) {
        Map<String, Object> result = new HashMap<>();
        result.put("status", code);
        result.put("message", message);
        return result;
    }
}
